package com.zhu.tool_test.callback;

import com.zhu.tool_test.entity.Device;

import java.util.List;
import java.util.Optional;

/**
 * @program: tool_test
 * @description: 回调demo
 * @author: ggBall
 * @create: 2021-03-05 16:43
 **/
public class CallBackDemo {

    public static void main(String[] args) {
        MinDataEventCallBack minDataEventCallBack = new MinDataEventCallBack();
        minDataEventCallBack.process("sss");

        DataEventCallBack dataEventCallBack = new DataEventCallBack() {
            /***
             *
             * @Description: 插入数据
             * @author: ggBall
             * @date 2021/3/5 15:43
             * @return: boolean 插入成功返回false
             * @since 1.0
             * @param json
             */
            @Override
            public Optional<List<Device>> insertData(String json) {
                return Optional.empty();
            }

            /***
             *
             * @Description: 告警操作
             * @author: ggBall
             * @date 2021/3/5 15:52
             *
             * @return: java.util.Optional<java.lang.Object>
             * @since 1.0
             */
            @Override
            public Optional<Object> alarm() {
                return Optional.empty();
            }

            /***
             *
             * @Description: 站点更新操作
             * @author: ggBall
             * @date 2021/3/5 15:54
             *
             * @return: java.lang.Boolean
             * @since 1.0
             */
            @Override
            public Boolean updateSiteState() {
                return null;
            }
        };
    }
}
